Developer Documentation

QuickTime 4 API Documentation

Programming With QuickTime VR

| Previous | Chapter Contents | Chapter Top | Next |

Intercepting QuickTime VR Manager Routines

The QuickTime VR Manager provides a function that you can use to install an intercept procedure. Your intercept procedure can provide either alternative or additional functionality to that provided by the intercepted procedure.

QTVRInstallInterceptProc

You can use the QTVRInstallInterceptProc function to install or remove an intercept procedure for a QuickTime VR Manager function.

OSErr QTVRInstallInterceptProc (
                     QTVRInstanceqtvr,
                     QTVRProcSelectorselector,
                     QTVRInterceptUPPinterceptProc,
                     SInt32refCon,
                     UInt32 flags);
qtvr
An instance of a QuickTime VR movie.
selector
A selector that indicates which QuickTime VR function to intercept. See "Intercept Selectors" for a description of the available intercept selectors.
interceptProc
A universal procedure pointer for an intercept procedure. See "QuickTime VR Intercept Procedure" for information about intercept procedures. Set this parameter to nil to remove a previously installed intercept procedure.
refCon
A reference constant. This value is passed to the specified intercept routine.
flags
Unused. Set this parameter to 0.
function result
A result code.

DESCRIPTION

The QTVRInstallInterceptProc function installs the procedure specified by the interceptProc parameter as an intercept procedure for the QuickTime VR function specified by the selector parameter for the QuickTime VR movie specified by the qtvr parameter. Your intercept procedure is called whenever QuickTime VR is about to execute the function you are intercepting. Your procedure can simply replace the intercepted function (by returning the value true in its cancel parameter); it can call through to the intercepted function (by calling the QTVRCallInterceptedProc function); or it can allow the intercepted function to execute when the intercept procedure returns (by returning the value false in its cancel parameter).

SEE ALSO

For examples of the use of the QTVRInstallInterceptProc function, see Listing 2-7 and Listing 4-2 in Chapter 4, "QuickTime VR Atom Containers."

QTVRCallInterceptedProc

You can use the QTVRCallInterceptedProc function to call an intercepted QuickTime VR function from within an intercept procedure.

OSErr QTVRCallInterceptedProc (
                     QTVRInstanceqtvr,
                     QTVRInterceptRecord*qtvrMsg);
qtvr
An instance of a QuickTime VR movie.
qtvrMsg
An intercept record (link) that specifies the function that your procedure is intercepting and the parameters for that function. This should be the same intercept record passed to your intercept procedure.
function result
A result code.

DESCRIPTION

The QTVRCallInterceptedProc function executes the QuickTime VR Manager function indicated by the selector field of the qtvrMsg intercept record. The parameters passed to that function are the QuickTime VR movie specified by the qtvr parameter and any other parameters contained in the parameter field of the qtvrMsg record. You can, if you wish, change the parameters in that field before calling QTVRCallInterceptedProc .

You can call QTVRCallInterceptedProc more than once in your intercept procedure. In addition, the QuickTime VR Manager will call the intercepted function again unless your intercept procedure returns true in its cancel parameter.

SPECIAL CONSIDERATIONS

You should call QTVRCallInterceptedProc only in an intercept procedure.

SEE ALSO

See "QuickTime VR Intercept Procedure" for information about intercept procedures. Listing 2-6 illustrates the use of QTVRCallInterceptedProc .


© 1998 Apple Computer, Inc.

| Previous | Chapter Contents | Chapter Top | Next |